import type { RespSysDataType } from "../../../api"

/**
 * 响应数据类型
 */
export declare namespace RespDataType {
  export interface RoleItem {
    id: number,
    status: number,
    listOrder: number,
    name: string,
    remark: string,
    dataScope: number,  // 数据范围
    createdAt: string,
    updatedAt: string
  }

  export type RolePageList = PageList<RoleItem>;

  /**
   * 单个角色响应信息
   */
  export interface RoleInfo{
    role: RoleItem,
    // menuIds: number[]
  }
  
  /**
   * 角色参数响应数据
   */
  export interface RoleParams {
    menu: {
      id: number,
      pid: number,
      name: string,
      title: string,
      icon: string,
      condition: string,
      remark: string,
      menuType: number,
      weigh: number,
      isHide: number,
      isCached: number,
      isAffix: number,
      path: string,
      redirect: string,
      component: string,
      isIframe: number,
      isLink: number,
      linkUrl: string
    }[]
  }

  // 角色自定义的数据范围
  export interface RoleSelectedCustomDataScope {
    checkedKeys: number[],
    depts: RespSysDataType.DeptTreeItem[];
  }

}

/**
 * 新增数据类型
 */
export declare namespace RequestDataType {
  export interface CreateRoleItem {
    status: string;
    name: string;
    listOrder: number,
    remark: string,
    // menuIds: number[];
  }

  export interface UpdateRoleItem {
    status: string;
    remark: string;
    name: string;
    // menuIds?: number[];
    id: number;
    listOrder: number,
  }

  export interface TreeItem {
    data: Array<any>;
  }
}



